protobuf.load("HardWare.proto",function (err,root) {
    if(err) throw err;

    var lightRequest = root.lookup("CommandEntity.LightRequest");
    console.log(lightRequest)
    var version = lightRequest.create({version:"10001"});
    console.log(version)
    var versionBuffer = lightRequest.encode(version).finish();
    console.log(versionBuffer)
    var decode =  lightRequest.decode(versionBuffer)
    console.log(decode)
});

protobuf.load("awesome.proto", function(err, root) {
    if (err) throw err;

    // Obtain a message type
    var AwesomeMessage = root.lookup("awesomepackage.AwesomeMessage");

    // Create a new message
    var message = AwesomeMessage.create({ awesomeField: "AwesomeString" });

    // Encode a message
    var buffer = AwesomeMessage.encode(message).finish();
    // ... do something with buffer

    // Or, encode a plain object
    var buffer = AwesomeMessage.encode({ awesomeField: "AwesomeString" }).finish();
    // ... do something with buffer

    // Decode a buffer
    var message = AwesomeMessage.decode(buffer);
    // console.log(message)
    // ... do something with message

    // If your application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited.
});
